var express = require('express');
var router = express.Router();
var db = require('./db.js');
router.post('/get10', function(req, res, next) {
    let sql = "select * from words"
    const list = req.body.list
    if(list){
        sql = sql +` where id not in (${list})`
    }
    sql = sql+" limit 0,10"
    db.query(sql, function(err, rows) {
        if (err) {
            res.send([]);
        } else {
            res.send(rows);
        }
    })
});
/* GET home page. */
router.get('/', function(req, res, next) {
    
    WSRouter.sendMsg('From table data');
   // res.send("ok");
});

module.exports = router;
